package com.app.util;

import com.app.model.Group;
import com.app.model.ListGroup;
import com.app.model.User;
import com.google.gson.Gson;

public class UtilGson {

    private static final Gson gson = new Gson();

    public static User jsonToUser(String json) {
	return gson.fromJson(json, User.class);
    }

    public static Group jsonToGroup(String json) {
	return gson.fromJson(json, Group.class);
    }

    public static ListGroup jsonToListGroup(String json) {
	return gson.fromJson(json, ListGroup.class);
    }

    public static String groupToJson(Group group) {
	return gson.toJson(group, Group.class);
    }

    public static String userToJson(User user) {
	return gson.toJson(user, User.class);
    }

}
